export default function OperationHook(state: Base.GeneraDataType) {
  const { dialogOpts, formState } = state;

  const modifyWaybillHandle = (row: Base.GeneraDataType) => {
    dialogOpts.title = `修改运单(${row.waybillNum})`;
    dialogOpts.type = 2;
    dialogOpts.passData = row;
    dialogOpts.component = "ModifyWaybill";
    dialogOpts.visible = true;
  };
  const modifyTimeHandle = () => {
    dialogOpts.width = "520px";
    dialogOpts.title = "修改期望取货时间";
    dialogOpts.type = 2;
    dialogOpts.passData = formState.value;
    dialogOpts.component = "ModifyTime";
    dialogOpts.visible = true;
  };
  const modifyWarehouseHandle = () => {
    dialogOpts.width = "820px";
    dialogOpts.title = "修改送货仓库";
    dialogOpts.type = 2;
    dialogOpts.passData = formState.value;
    dialogOpts.component = "ModifyWarehouse";
    dialogOpts.visible = true;
  };
  const modifyPickupAddressHandle = () => {
    dialogOpts.width = "820px";
    dialogOpts.title = "修改取件地址";
    dialogOpts.type = 2;
    dialogOpts.passData = formState.value;
    dialogOpts.component = "ModifyPickupAddress";
    dialogOpts.visible = true;
  };
  return {
    modifyWaybillHandle,
    modifyTimeHandle,
    modifyWarehouseHandle,
    modifyPickupAddressHandle
  };
}
